home *** CD-ROM | disk | FTP | other *** search
/ Sprite 1984 - 1993 / Sprite 1984 - 1993.iso / src / lib / c / stdlib / RCS / Mem_SetTraceSizes.c,v < prev    next >
Encoding:
Text File  |  1991-12-03  |  2.4 KB  |  111 lines

  1. head     1.1;
  2. branch   ;
  3. access   ;
  4. symbols  sprited:1.1.1;
  5. locks    ; strict;
  6. comment  @ * @;
  7.  
  8.  
  9. 1.1
  10. date     88.05.20.15.49.26;  author ouster;  state Exp;
  11. branches 1.1.1.1;
  12. next     ;
  13.  
  14. 1.1.1.1
  15. date     91.12.02.20.38.25;  author kupfer;  state Exp;
  16. branches ;
  17. next     ;
  18.  
  19.  
  20. desc
  21. @@
  22.  
  23.  
  24.  
  25. 1.1
  26. log
  27. @Initial revision
  28. @
  29. text
  30. @/* 
  31.  * Mem_SetTraceSizes.c --
  32.  *
  33.  *    Source code for the "Mem_SetTraceSizes" library procedure.  See
  34.  *    memInt.h for overall information about how the allocator works.
  35.  *
  36.  * Copyright 1988 Regents of the University of California
  37.  * Permission to use, copy, modify, and distribute this
  38.  * software and its documentation for any purpose and without
  39.  * fee is hereby granted, provided that the above copyright
  40.  * notice appear in all copies.  The University of California
  41.  * makes no representations about the suitability of this
  42.  * software for any purpose.  It is provided "as is" without
  43.  * express or implied warranty.
  44.  */
  45.  
  46. #ifndef lint
  47. static char rcsid[] = "$Header: proto.c,v 1.2 88/03/11 08:39:08 ouster Exp $ SPRITE (Berkeley)";
  48. #endif not lint
  49.  
  50. #include "memInt.h"
  51.  
  52. /*
  53.  *----------------------------------------------------------------------
  54.  *
  55.  * Mem_SetTraceSizes --
  56.  *
  57.  *    Defines a list of sizes to trace and causes tracing to start.
  58.  *    If the numSizes is zero or the array ptr is NULL, tracing is
  59.  *    turned off.
  60.  *
  61.  * Results:
  62.  *    None.
  63.  *
  64.  * Side effects:
  65.  *    Traces of Mem_Alloc and Mem_Free start or end.
  66.  *
  67.  *----------------------------------------------------------------------
  68.  */
  69. ENTRY void
  70. Mem_SetTraceSizes(numSizes, arrayPtr)
  71.     int          numSizes;        /* # of elements in arrayPtr */
  72.     Mem_TraceInfo *arrayPtr;        /* Array of block sizes to trace. */
  73. {
  74.     int    i;
  75.  
  76.     LOCK_MONITOR;
  77.  
  78.     if (numSizes <= 0 || (arrayPtr == (Mem_TraceInfo *) NULL) 
  79.         || arrayPtr == (Mem_TraceInfo *)NULL) {
  80.     if (numSizes == -1) {
  81.         memNumSizesToTrace = -1;
  82.     } else {
  83.         memNumSizesToTrace = 0;
  84.     }
  85.     UNLOCK_MONITOR;
  86.     return;
  87.     }  
  88.  
  89.     if (numSizes > MAX_NUM_TRACE_SIZES) {
  90.     numSizes = MAX_NUM_TRACE_SIZES;
  91.     }
  92.     memNumSizesToTrace = numSizes;
  93.     for (i = 0; i < numSizes; i++) {
  94.     memTraceArray[i].traceInfo = arrayPtr[i];
  95.     memTraceArray[i].traceInfo.flags |= MEM_TRACE_NOT_INIT;
  96.     }
  97.     UNLOCK_MONITOR;
  98. }
  99. @
  100.  
  101.  
  102. 1.1.1.1
  103. log
  104. @Initial branch for Sprite server.
  105. @
  106. text
  107. @d18 1
  108. a18 1
  109. static char rcsid[] = "$Header: /sprite/src/lib/c/stdlib/RCS/Mem_SetTraceSizes.c,v 1.1 88/05/20 15:49:26 ouster Exp $ SPRITE (Berkeley)";
  110. @
  111.